home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / vim_src.zip / TERM.H < prev    next >
C/C++ Source or Header  |  1993-01-12  |  7KB  |  333 lines

  1. /* vi:ts=4:sw=4
  2.  *
  3.  * term.h -- VIM - Vi IMitation
  4.  *
  5.  * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  6.  *                            Tim Thompson            twitch!tjt
  7.  *                            Tony Andrews            onecom!wldrdg!tony 
  8.  *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  9.  */
  10.  
  11. /*
  12.  * This file contains the machine dependent escape sequences that the editor
  13.  * needs to perform various operations. Some of the sequences here are
  14.  * optional. Anything not available should be indicated by a null string. In
  15.  * the case of insert/delete line sequences, the editor checks the capability
  16.  * and works around the deficiency, if necessary.
  17.  */
  18.  
  19. /*
  20.  * the terminal capabilities are stored in this structure
  21.  * keep in sync with array in term.c
  22.  */
  23. typedef struct _tcarr
  24. {
  25. /* output codes */
  26.   char *t_name;        /* name of this terminal entry */
  27.   char *t_el;        /* el       ce    clear to end of line */
  28.   char *t_il;        /* il1      al    add new blank line */
  29.   char *t_cil;        /* il       AL    add number of blank lines */
  30.   char *t_dl;        /* dl1      dl    delete line */
  31.   char *t_cdl;        /* dl       DL    delete number of lines */
  32.   char *t_ed;        /* clear    cl    clear screen */
  33.   char *t_ci;        /* civis    vi    cursur invisible */
  34.   char *t_cv;        /* cnorm    ve    cursur visible */
  35.   char *t_tp;        /* sgr0     me    normal mode */
  36.   char *t_ti;        /* rev      mr    reverse mode */
  37.   char *t_cm;        /* cup      cm    cursor motion */
  38.   char *t_sr;        /* ri       sr    scroll reverse (backward) */
  39.   char *t_cri;        /* cuf      RI    cursor number of chars right */
  40.   char *t_vb;        /* flash    vb    visual bell */
  41.   char *t_ks;        /* smkx     ks    put terminal in "keypad transmit" mode */
  42.   char *t_ke;        /* rmkx     ke    out of "keypad transmit" mode */
  43.  
  44. /* key codes */
  45.   char *t_ku;        /* kcuu1    ku    arrow up */
  46.   char *t_kd;        /* kcud1    kd    arrow down */
  47.   char *t_kl;        /* kcub1    kl    arrow left */
  48.   char *t_kr;        /* kcuf1    kr    arrow right */
  49.   char *t_sku;        /* shift arrow up */
  50.   char *t_skd;        /* shift arrow down */
  51.   char *t_skl;        /* kLFT     #4    shift arrow left */
  52.   char *t_skr;        /* kRIT     %    shift arrow right */
  53.   char *t_f1;        /* kf1      k1    function key 1 */
  54.   char *t_f2;        /* kf2      k2    function key 2 */
  55.   char *t_f3;        /* kf3      k3    function key 3 */
  56.   char *t_f4;        /* kf4      k4    function key 4 */
  57.   char *t_f5;        /* kf5      k5    function key 5 */
  58.   char *t_f6;        /* kf6      k6    function key 6 */
  59.   char *t_f7;        /* kf7      k7    function key 7 */
  60.   char *t_f8;        /* kf8      k8    function key 8 */
  61.   char *t_f9;        /* kf9      k9    function key 9 */
  62.   char *t_f10;        /* kf10     k;    function key 10 */
  63.   char *t_sf1;        /* kf11     F1    shifted function key 1 */
  64.   char *t_sf2;        /* kf12     F2    shifted function key 2 */
  65.   char *t_sf3;        /* kf13     F3    shifted function key 3 */
  66.   char *t_sf4;        /* kf14     F4    shifted function key 4 */
  67.   char *t_sf5;        /* kf15     F5    shifted function key 5 */
  68.   char *t_sf6;        /* kf16     F6    shifted function key 6 */
  69.   char *t_sf7;        /* kf17     F7    shifted function key 7 */
  70.   char *t_sf8;        /* kf18     F8    shifted function key 8 */
  71.   char *t_sf9;        /* kf19     F9    shifted function key 9 */
  72.   char *t_sf10;        /* kf20     FA    shifted function key 10 */
  73.   char *t_help;        /* khlp     %1    help key */
  74.   char *t_undo;        /* kund     &8    undo key */
  75.   /* adjust inchar() for last entry */
  76. } Tcarr;
  77.  
  78. extern Tcarr term_strings;    /* currently used terminal strings */
  79.  
  80. /*
  81.  * strings used for terminal
  82.  */
  83. #define T_EL    (term_strings.t_el)
  84. #define T_IL    (term_strings.t_il)
  85. #define T_CIL    (term_strings.t_cil)
  86. #define T_DL    (term_strings.t_dl)
  87. #define T_CDL    (term_strings.t_cdl)
  88. #define T_ED    (term_strings.t_ed)
  89. #define T_CI    (term_strings.t_ci)
  90. #define T_CV    (term_strings.t_cv)
  91. #define T_TP    (term_strings.t_tp)
  92. #define T_TI    (term_strings.t_ti)
  93. #define T_CM    (term_strings.t_cm)
  94. #define T_SR    (term_strings.t_sr)
  95. #define T_CRI    (term_strings.t_cri)
  96. #define T_VB    (term_strings.t_vb)
  97. #define T_KS    (term_strings.t_ks)
  98. #define T_KE    (term_strings.t_ke)
  99.  
  100.  
  101. #ifndef NO_BUILTIN_TCAPS
  102. /*
  103.  * here are the builtin termcap entries.
  104.  * They not stored as complete Tcarr structures, as such a structure 
  105.  * is to big. 
  106.  * Each termcap is a concatenated string of entries, where '\0' characters
  107.  * followed by a skip character sepereate the capabilities. The skip 
  108.  * character is the relative structure offset for the following entry.
  109.  * See parse_builtin_tcap() in term.c for all details.
  110.  */
  111. # define AMIGA_TCAP "amiga\0\
  112. \0\033[K\0\
  113. \0\033[L\0\
  114. \0\033[%dL\0\
  115. \0\033[M\0\
  116. \0\033[%dM\0\
  117. \0\014\0\
  118. \0\033[0 p\0\
  119. \0\033[1 p\0\
  120. \0\033[0m\0\
  121. \0\033[7m\0\
  122. \0\033[%i%d;%dH\0\
  123. \1\033[%dC\0\
  124. \3\233A\0\
  125. \0\233B\0\
  126. \0\233D\0\
  127. \0\233C\0\
  128. \0\233T\0\
  129. \0\233S\0\
  130. \0\233 A\0\
  131. \0\233 @\0\
  132. \0\2330~\0\
  133. \0\2331~\0\
  134. \0\2332~\0\
  135. \0\2333~\0\
  136. \0\2334~\0\
  137. \0\2335~\0\
  138. \0\2336~\0\
  139. \0\2337~\0\
  140. \0\2338~\0\
  141. \0\2339~\0\
  142. \0\23310~\0\
  143. \0\23311~\0\
  144. \0\23312~\0\
  145. \0\23313~\0\
  146. \0\23314~\0\
  147. \0\23315~\0\
  148. \0\23316~\0\
  149. \0\23317~\0\
  150. \0\23318~\0\
  151. \0\23319~\0\
  152. \0\233?~\0\
  153. \0\0"
  154.  
  155. # define ATARI_TCAP "atari\0\
  156. \0\033l\0\
  157. \0\033L\0\
  158. \1\033M\0\
  159. \1\033E\0\
  160. \0\033f\0\
  161. \0\033e\0\
  162. \0\0"
  163.  
  164. # define ANSI_TCAP "ansi\0\
  165. \0\033[2K\0\
  166. \0\033[L\0\
  167. \0\033[%dL\0\
  168. \0\033[M\0\
  169. \0\033[%dM\0\
  170. \0\033[2J\0\
  171. \2\033[0m\0\
  172. \0\033[7m\0\
  173. \0\033[%i%d;%dH\0\
  174. \1\033[%dC\0\
  175. \0\0"
  176.  
  177. /*
  178.  * Function keys on a PC are preceded with a NUL. These are converted into
  179.  * K_ZERO '\236' in GetChars(), because we cannot handle NULs in key codes.
  180.  * CTRL-arrow is used instead of SHIFT-arrow.
  181.  */
  182. # define PCTERM_TCAP "pcterm\0\
  183. \0\033[K\0\
  184. \0\033|L\0\
  185. \1\033|M\0\
  186. \1\033[2J\0\
  187. \2\033[0m\0\
  188. \0\033[7m\0\
  189. \0\033[%i%d;%dH\0\
  190. \1\033[%dC\0\
  191. \3\236H\0\
  192. \0\236P\0\
  193. \0\236K\0\
  194. \0\236M\0\
  195. \2\236s\0\
  196. \0\236t\0\
  197. \0\236;\0\
  198. \0\236<\0\
  199. \0\236=\0\
  200. \0\236>\0\
  201. \0\236?\0\
  202. \0\236@\0\
  203. \0\236A\0\
  204. \0\236B\0\
  205. \0\236C\0\
  206. \0\236D\0\
  207. \0\236T\0\
  208. \0\236U\0\
  209. \0\236V\0\
  210. \0\236W\0\
  211. \0\236X\0\
  212. \0\236Y\0\
  213. \0\236Z\0\
  214. \0\236[\0\
  215. \0\236\\\0\
  216. \0\236]\0\
  217. \0\0"
  218.  
  219. # define VT52_TCAP "vt52\0\
  220. \0\033K\0\
  221. \0\033T\0\
  222. \1\033U\0\
  223. \1\014\0\
  224. \2\033SO\0\
  225. \0\033S2\0\
  226. \0\033Y%+ %+ \0\
  227. \0\0"
  228.  
  229. # define XTERM_TCAP "xterm\0\
  230. \0\033[K\0\
  231. \0\033[L\0\
  232. \0\033[%dL\0\
  233. \0\033[M\0\
  234. \0\033[%dM\0\
  235. \0\033[2J\0\
  236. \2\033[m\0\
  237. \0\033[7m\0\
  238. \0\033[%i%d;%dH\0\
  239. \0\033M\0\
  240. \0\033[%dC\0\
  241. \1\033[?1h\0\
  242. \0\033[?0h\0\
  243. \0\033[OA\0\
  244. \0\033[OB\0\
  245. \0\033[OD\0\
  246. \0\033[OC\0\
  247. \0\033[Ox\0\
  248. \0\033[Or\0\
  249. \0\033[Ot\0\
  250. \0\033[Ov\0\
  251. \0\033[12~\0\
  252. \0\033[13~\0\
  253. \0\033[14~\0\
  254. \0\033[15~\0\
  255. \0\033[16~\0\
  256. \0\033[17~\0\
  257. \0\033[18~\0\
  258. \0\033[19~\0\
  259. \0\033[20~\0\
  260. \0\033[21~\0\
  261. \0\033[23~\0\
  262. \0\033[24~\0\
  263. \10\033[28~\0\
  264. \0\033[26~\0\
  265. \0\0"
  266.  
  267. # define DEBUG_TCAP "debug\0\
  268. \0[EL]\0\
  269. \0[IL]\0\
  270. \0[CIL%d]\0\
  271. \0[DL]\0\
  272. \0[CDL%d]\0\
  273. \0[ED]\0\
  274. \0[CI]\0\
  275. \0[CV]\0\
  276. \0[TP]\0\
  277. \0[TI]\0\
  278. \0[%dCM%d]\0\
  279. \0[SR]\0\
  280. \0[CRI%d]\0\
  281. \0[VB]\0\
  282. \0[KS]\0\
  283. \0[KE]\0\
  284. \0[KU]\0\
  285. \0[KD]\0\
  286. \0[KL]\0\
  287. \0[KR]\0\
  288. \0[SKU]\0\
  289. \0[SKD]\0\
  290. \0[SKL]\0\
  291. \0[SKR]\0\
  292. \0[F1]\0\
  293. \0[F2]\0\
  294. \0[F3]\0\
  295. \0[F4]\0\
  296. \0[F5]\0\
  297. \0[F6]\0\
  298. \0[F7]\0\
  299. \0[F8]\0\
  300. \0[F9]\0\
  301. \0[F10]\0\
  302. \0[SF1]\0\
  303. \0[SF2]\0\
  304. \0[SF3]\0\
  305. \0[SF4]\0\
  306. \0[SF5]\0\
  307. \0[SF6]\0\
  308. \0[SF7]\0\
  309. \0[SF8]\0\
  310. \0[SF9]\0\
  311. \0[SF10]\0\
  312. \0[HELP]\0\
  313. \0[UNDO]\0\
  314. \0\0"
  315.  
  316. # ifdef ATARI
  317. #  define DFLT_TCAP ATARI_TCAP
  318. # endif /* ATARI */
  319.  
  320. # ifdef AMIGA
  321. #  define DFLT_TCAP AMIGA_TCAP
  322. # endif /* AMIGA */
  323.  
  324. # ifdef MSDOS
  325. #  define DFLT_TCAP PCTERM_TCAP
  326. # endif /* MSDOS */
  327.  
  328. # ifdef UNIX
  329. #  define DFLT_TCAP ANSI_TCAP
  330. # endif /* UNIX */
  331.  
  332. #endif /* NO_BUILTIN_TCAPS */
  333.